"""
加载数据：文本文件
"""
import numpy as np
import pandas as pd

data = pd.read_csv('CustomerSurvival.csv',
                   header=None,
                   names=['index','pack_type','extra_time','extra_flow','pack_change','contract','asso_pur','group_user','use_month','loss'],
                   index_col='index',
                   # 设置行级索引时，必须要设置索引列
                   usecols=['index','pack_type','extra_time','extra_flow','loss'])

# print(data)
# data1 = pd.read_csv('保健品字段介绍.csv')
# print(data1)

# 将df输出到文件中
# data.to_csv('new_data.csv')

# read_excel
# pip3 install xlrd==1.2.0
data1 = pd.read_excel('CustomerSurvival.xlsx')
print(data1)